package com.iams.elasticsearch.domain;


import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.util.Date;


@JsonIgnoreProperties(ignoreUnknown = true)
@Document(indexName = "archives")
public class ElasticsearchArchive {

    @Id
    private String id;

    @Field(type = FieldType.Keyword)
    private String mysqlDanghao;  // 对应MySQL中的档案ID

    @Field(type = FieldType.Text)
    private String title;  // 档案标题

    @JsonIgnore
    @Field(type = FieldType.Text)
    private String content;  // 文档内容

    @Field(type = FieldType.Keyword)
    private String fileType;  // 文件类型

    @Field(type = FieldType.Text)
    private String description;  // 档案描述

    @Field(type = FieldType.Keyword)
    private String secretLevel;  // 保密级别

    @Field(type = FieldType.Date)
    private Date createTime;  // 创建时间

    @Field(type = FieldType.Keyword)
    private String filePath;  // 文件路径

    // getters and setters
    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getMysqlDanghao() {
        return mysqlDanghao;
    }
    public void setMysqlDanghao(String mysqlDanghao) {
        this.mysqlDanghao = mysqlDanghao;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getFileType() {
        return fileType;
    }

    public void setFileType(String fileType) {
        this.fileType = fileType;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getSecretLevel() {
        return secretLevel;
    }

    public void setSecretLevel(String secretLevel) {
        this.secretLevel = secretLevel;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public String getFilePath() {
        return filePath;
    }

    public void setFilePath(String filePath) {
        this.filePath = filePath;
    }


}
